import { Http } from "../utils/http";

class Property extends Http {
  constructor(props) {
    super(props);
  }
  //用户有房间的房屋列表
  rentHouseList() {
    return this.request({
      url: "/mini/house/rentHouseList",
      method: "get",
      data: {},
    });
  }
  //报修列表;
  tRepairRecordList(pageNo, pageSize) {
    return this.request({
      url: "/mini/tRepairRecord/list",
      method: "get",
      data: {
        pageNo: pageNo ? pageNo : 1,
        pageSize: pageSize ? pageSize : 10,
      },
    });
  }
  //上传图片
  uploadImage() {
    return this.request({
      url: "/app/tRepairRecord/uploadPics",
      method: "post",
      data: {},
      header: {
        "Content-Type": "multipart/form-data",
      },
    });
  }
  // 报修;
  tRepairRecordAdd(
    commId,
    houseId,
    type,
    appointmentTime,
    remark,
    url,
    name,
    phone
  ) {
    return this.request({
      url: "/mini/tRepairRecord/add",
      method: "post",
      data: {
        commId,
        houseId,
        type,
        appointmentTime,
        remark,
        url,
        name,
        phone,
      },
      header: {
        "Content-Type": "multipart/form-data",
      },
    });
  }

  // 报修记录--详情
  tRepairRecordQueryById(id) {
    return this.request({
      url: "/mini/tRepairRecord/queryById",
      method: "get",
      data: {
        id,
      },
    });
  }
}

export { Property };
